<?php
use Faker\Generator as Faker;

/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\App\Models\Order::class, function (Faker $faker) {
    $refund_state = [0,1,2,11,12];
    array_shift($refund_state);

    return [
        'customer_id'       => $faker->numberBetween(1, 1230),
        'store_id'          => $faker->numberBetween(1, 1230),
        'device_account_id' => $faker->numberBetween(1, 1230),
        'product_id'        => $faker->numberBetween(1, 1230),
        'trad_no'           => $faker->uuid,
        'order_type'        => 1,
        'status_str'        => '已关闭',
        'pay_time'          => $faker->dateTime,
        'num'               => $faker->numberBetween(1, 20),
        'price'             => $faker->randomFloat(2, 0, 1000),
        'total_fee'         => $faker->numberBetween(1, 2360),
        'buyer'             => $faker->name,
        'refund_state'      => array_pop($refund_state),
    ];
});
